package com.Long.dtx.seatademo.bank1.dao;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator.
 */
@Mapper
@Component
public interface AccountInfoDao {
    //更新账户金额
    @Update("update account_info set account_balance = account_balance + #{amount} where account_no = #{accountNo}")
    int updateAccountBalance(@Param("accountNo") String accountNo, @Param("amount") Double amount);

    @Select("select count(1) from de_duplication where tx_no = #{txNo}")
    int isExistTx(@Param("txNo") String txNo);

    /*添加事物日志*/
    @Insert("insert into de_duplication values(#{txNo},now());")
    int addTx(@Param("txNo") String txNo);
}
